Repository navigation
[NoQA] [Insights] Add the Explain button and pass the Insights scope to Concierge - #104862
luacmartins merged 14 commits into
Conversation
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running: npx bun ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
🦜 Polyglot Parrot! 🦜Squawk! Looks like you added some shiny new English strings. Allow me to parrot them back to you in other tongues: View the translation diffdiff --git a/src/languages/de.ts b/src/languages/de.ts
index a8d78fb2..2804a088 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -1233,6 +1233,8 @@ const translations: TranslationDeepObject<typeof en> = {
},
compliance: 'Compliance',
runningTotal: 'Laufende Summe',
+ explain: 'Erklären',
+ explainChartPrompt: (chartTitle: string) => `Erklären Sie die Daten in ${chartTitle}.`,
},
allSettingsScreen: {
subscription: 'Abonnement',
diff --git a/src/languages/el.ts b/src/languages/el.ts
index ba10e7d6..d5116735 100644
--- a/src/languages/el.ts
+++ b/src/languages/el.ts
@@ -1277,6 +1277,8 @@ const translations: TranslationDeepObject<typeof en> = {
},
compliance: 'Συμμόρφωση',
runningTotal: 'Τρέχον σύνολο',
+ explain: 'Επεξήγηση',
+ explainChartPrompt: (chartTitle: string) => `Εξηγήστε τα δεδομένα στο ${chartTitle}.`,
},
allSettingsScreen: {
subscription: 'Συνδρομή',
diff --git a/src/languages/es.ts b/src/languages/es.ts
index 38e74eae..5fb35bb7 100644
--- a/src/languages/es.ts
+++ b/src/languages/es.ts
@@ -1225,6 +1225,8 @@ const translations: TranslationDeepObject<typeof en> = {
},
compliance: 'Cumplimiento',
runningTotal: 'Total acumulado',
+ explain: 'Explicar',
+ explainChartPrompt: (chartTitle: string) => `Explica los datos en ${chartTitle}.`,
},
allSettingsScreen: {
subscription: 'Suscripcion',
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index dddf5495..ae648cb0 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -1237,6 +1237,8 @@ const translations: TranslationDeepObject<typeof en> = {
},
compliance: 'Conformité',
runningTotal: 'Total cumulé',
+ explain: 'Expliquer',
+ explainChartPrompt: (chartTitle: string) => `Expliquez les données dans ${chartTitle}.`,
},
allSettingsScreen: {
subscription: 'Abonnement',
diff --git a/src/languages/it.ts b/src/languages/it.ts
index 5db8994b..2c34b8d0 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -1233,6 +1233,8 @@ const translations: TranslationDeepObject<typeof en> = {
},
compliance: 'Conformità',
runningTotal: 'Totale progressivo',
+ explain: 'Spiega',
+ explainChartPrompt: (chartTitle: string) => `Spiega i dati in ${chartTitle}.`,
},
allSettingsScreen: {
subscription: 'Abbonamento',
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index ff6deb7d..1bb34ee0 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -1221,6 +1221,8 @@ const translations: TranslationDeepObject<typeof en> = {
},
compliance: 'コンプライアンス',
runningTotal: '累計合計',
+ explain: '説明',
+ explainChartPrompt: (chartTitle: string) => `${chartTitle} のデータを説明します。`,
},
allSettingsScreen: {
subscription: 'サブスクリプション',
@@ -7472,7 +7474,6 @@ _詳しい手順については、[ヘルプサイトをご覧ください](${CO
title: 'メンバーをコピー',
prompt: ({count, targetWorkspaceName}: {count: number; targetWorkspaceName: string}) => ({
one: `${targetWorkspaceName}のメンバーをこのワークスペースのメンバーで置き換えてもよろしいですか?`,
- // Japanese has no "one" plural category, so handle the single-workspace case here
other:
count === 1
? `${targetWorkspaceName}のメンバーをこのワークスペースのメンバーで置き換えてもよろしいですか?`
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index 7298f782..6fd14c66 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -1232,6 +1232,8 @@ const translations: TranslationDeepObject<typeof en> = {
},
compliance: 'Naleving',
runningTotal: 'Doorlopend totaal',
+ explain: 'Uitleg',
+ explainChartPrompt: (chartTitle: string) => `Leg de gegevens in ${chartTitle} uit.`,
},
allSettingsScreen: {
subscription: 'Abonnement',
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index 6e5d686a..5d5e90cb 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -1256,6 +1256,8 @@ const translations: TranslationDeepObject<typeof en> = {
},
compliance: 'Zgodność',
runningTotal: 'Suma narastająco',
+ explain: 'Wyjaśnij',
+ explainChartPrompt: (chartTitle: string) => `Wyjaśnij dane w ${chartTitle}.`,
},
allSettingsScreen: {
subscription: 'Subskrypcja',
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index 1c559cae..e298813b 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -1232,6 +1232,8 @@ const translations: TranslationDeepObject<typeof en> = {
},
compliance: 'Conformidade',
runningTotal: 'Total acumulado',
+ explain: 'Explicar',
+ explainChartPrompt: (chartTitle: string) => `Explique os dados em ${chartTitle}.`,
},
allSettingsScreen: {
subscription: 'Assinatura',
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index 010663a7..2e13afaf 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -1186,6 +1186,8 @@ const translations: TranslationDeepObject<typeof en> = {
},
compliance: '合规',
runningTotal: '累计总额',
+ explain: '解释',
+ explainChartPrompt: (chartTitle: string) => `解释「${chartTitle}」中的数据。`,
},
allSettingsScreen: {
subscription: '订阅',
@@ -7299,7 +7301,6 @@ _如需更详细的说明,请[访问我们的帮助网站](${CONST.NETSUITE_IM
title: '复制成员',
prompt: ({count, targetWorkspaceName}: {count: number; targetWorkspaceName: string}) => ({
one: `确定要用此工作区的成员替换 ${targetWorkspaceName} 的成员吗?`,
- // Chinese has no "one" plural category, so handle the single-workspace case here
other: count === 1 ? `确定要用此工作区的成员替换 ${targetWorkspaceName} 的成员吗?` : `确定要用此工作区的成员替换 ${count} 个工作区的成员吗?`,
}),
},
Note You can apply these changes to your branch by copying the patch to your clipboard, then running |
OlGierd03
left a comment
There was a problem hiding this comment.
Looks great, one small comment
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 510f172028
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppScreen.Recording.2026-11-04.at.01.39.18.moviOS: mWeb SafariScreen.Recording.2026-11-04.at.01.38.10.movMacOS: Chrome / SafariScreen.Recording.2026-11-04.at.01.35.00.mov |
|
@mhawryluk We have conflicts |
|
resolved ✅ |
|
🚧 JmillsExpensify has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
JmillsExpensify
left a comment
There was a problem hiding this comment.
The project work for this PR looks solid, though @luacmartins look at the response I'm getting from Concierge with the prompted question.
Is that coming from this project or do we need to flag with the AI team?
it looks like the asterisk in the merchant name broke the response |
|
I'll investigate. Meanwhile, I think we can move forward with this PR since this feature is behind a beta. |
|
🚧 luacmartins has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 9.5.32-0 🚀
|
|
Recommend one FullStory custom element for the Explain buttons. The PR already adds the stable identifier, so no additional tracking code is needed. Created Track Insights Explain buttons for contextual Concierge answers, labeled |
|
🚀 Deployed to production by https://github.com/lakchote in version: 9.5.32-7 🚀
|
Explanation of Change
Adds an Explain button under each AI insight card on the Insights dashboard. Pressing it sends the insight's prompt to Concierge, along with the dashboard's search key, workspaces, date and currency, so the answer covers the data on screen. To support this,
SidePanelContextgains an optionalinsightsScope, andaskConciergenow takes an optionalsidePanelContextthat it passes toaddComment. The AI card loading skeleton also gets a placeholder for the Explain button.Gated behind the
insightsAIbeta.Fixed Issues
$ #102759
$ #102761
PROPOSAL: N/A
Tests
insightsAIbeta. Open Insights.Offline tests
QA Steps
No tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
Simulator.Screen.Recording.-.iPhone.17.-.2026-11-03.at.11.06.41.mov
iOS: mWeb Safari
MacOS: Chrome / Safari
Nagranie.z.ekranu.2026-11-3.o.10.47.53.mov
Nagranie.z.ekranu.2026-11-3.o.10.45.46.mov